/**
 * 
 */
package org.lex.explorer.directory;

import java.io.File;
import java.util.Arrays;

import javax.swing.filechooser.FileSystemView;

public class FileSystemRootNode extends FileNode {
	private static FileSystemView fsv = FileSystemView.getFileSystemView();

	public FileSystemRootNode() {
		super(new File("/"));
	}

	protected void loadChildren() {
		File[] roots = fsv.getRoots();
		// File[] roots = File.listRoots();
		if (roots != null) {
			Arrays.sort(roots);
			for (File root : roots)
				add(new FileNode(root));
		}
	}

	public String toString() {
		return "/";
	}
}